Left Termination of the query pattern avg_in_3(g, a, g) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

avg(s(X), Y, Z) :- avg(X, s(Y), Z).
avg(X, s(s(s(Y))), s(Z)) :- avg(s(X), Y, Z).
avg(0, 0, 0).
avg(0, s(0), 0).
avg(0, s(s(0)), s(0)).

Queries:

avg(g,a,g).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
avg_in: (b,f,b) (f,b,b) (b,f,f) (f,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg
avg_out_gag(x1, x2, x3)  =  avg_out_gag
U2_gag(x1, x2, x3, x4)  =  U2_gag(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg
avg_out_gag(x1, x2, x3)  =  avg_out_gag
U2_gag(x1, x2, x3, x4)  =  U2_gag(x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_GAG(s(X), Y, Z) → U1_GAG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_GAG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(s(X), Y, Z) → U1_AGG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → U2_AGG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(s(X), Y, Z) → U1_GAA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(s(X), Y, Z) → U1_AGA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → U2_AGA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → U2_GAA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → U2_GAG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg
avg_out_gag(x1, x2, x3)  =  avg_out_gag
U2_gag(x1, x2, x3, x4)  =  U2_gag(x4)
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x4)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x4)
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAG(x1, x2, x3)  =  AVG_IN_GAG(x1, x3)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x4)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x4)
U1_AGA(x1, x2, x3, x4)  =  U1_AGA(x4)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)
U1_AGG(x1, x2, x3, x4)  =  U1_AGG(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_GAG(s(X), Y, Z) → U1_GAG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_GAG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(s(X), Y, Z) → U1_AGG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → U2_AGG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(s(X), Y, Z) → U1_GAA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(s(X), Y, Z) → U1_AGA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → U2_AGA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → U2_GAA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → U2_GAG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg
avg_out_gag(x1, x2, x3)  =  avg_out_gag
U2_gag(x1, x2, x3, x4)  =  U2_gag(x4)
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x4)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x4)
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAG(x1, x2, x3)  =  AVG_IN_GAG(x1, x3)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x4)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x4)
U1_AGA(x1, x2, x3, x4)  =  U1_AGA(x4)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)
U1_AGG(x1, x2, x3, x4)  =  U1_AGG(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg
avg_out_gag(x1, x2, x3)  =  avg_out_gag
U2_gag(x1, x2, x3, x4)  =  U2_gag(x4)
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Instantiation
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_GAA(X) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)
AVG_IN_AGA(Y) → AVG_IN_AGA(s)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule AVG_IN_AGA(Y) → AVG_IN_AGA(s) we obtained the following new rules:

AVG_IN_AGA(s) → AVG_IN_AGA(s)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
QDP
                            ↳ Instantiation
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_AGA(s) → AVG_IN_AGA(s)
AVG_IN_GAA(X) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule AVG_IN_GAA(X) → AVG_IN_GAA(s) we obtained the following new rules:

AVG_IN_GAA(s) → AVG_IN_GAA(s)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Instantiation
QDP
                                ↳ NonTerminationProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_AGA(s) → AVG_IN_AGA(s)
AVG_IN_GAA(s) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_AGA(s) → AVG_IN_AGA(s)
AVG_IN_GAA(s) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)

The TRS R consists of the following rules:none


s = AVG_IN_AGA(s) evaluates to t =AVG_IN_AGA(s)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from AVG_IN_AGA(s) to AVG_IN_AGA(s).





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg
avg_out_gag(x1, x2, x3)  =  avg_out_gag
U2_gag(x1, x2, x3, x4)  =  U2_gag(x4)
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Instantiation
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(Y, Z) → AVG_IN_AGG(s, Z)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule AVG_IN_AGG(Y, Z) → AVG_IN_AGG(s, Z) we obtained the following new rules:

AVG_IN_AGG(s, z1) → AVG_IN_AGG(s, z1)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
QDP
                            ↳ ATransformationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(s, z1) → AVG_IN_AGG(s, z1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ ATransformationProof
QDP
                                ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

s(z1) → s(z1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

s(z1) → s(z1)

The TRS R consists of the following rules:none


s = s(z1) evaluates to t =s(z1)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from s(z1) to s(z1).




We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
avg_in: (b,f,b) (f,b,b) (b,f,f) (f,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x3, x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x2, x3, x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x2, x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x1, x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x2, x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg(x2, x3)
avg_out_gag(x1, x2, x3)  =  avg_out_gag(x1, x3)
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x3, x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x2, x3, x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x2, x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x1, x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x2, x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg(x2, x3)
avg_out_gag(x1, x2, x3)  =  avg_out_gag(x1, x3)
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_GAG(s(X), Y, Z) → U1_GAG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_GAG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(s(X), Y, Z) → U1_AGG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → U2_AGG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(s(X), Y, Z) → U1_GAA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(s(X), Y, Z) → U1_AGA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → U2_AGA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → U2_GAA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → U2_GAG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x3, x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x2, x3, x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x2, x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x1, x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x2, x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg(x2, x3)
avg_out_gag(x1, x2, x3)  =  avg_out_gag(x1, x3)
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x4)
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x1, x4)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x4)
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAG(x1, x2, x3)  =  AVG_IN_GAG(x1, x3)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x1, x4)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x3, x4)
U1_AGA(x1, x2, x3, x4)  =  U1_AGA(x2, x4)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)
U1_AGG(x1, x2, x3, x4)  =  U1_AGG(x2, x3, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_GAG(s(X), Y, Z) → U1_GAG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_GAG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(s(X), Y, Z) → U1_AGG(X, Y, Z, avg_in_agg(X, s(Y), Z))
AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → U2_AGG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(s(X), Y, Z) → U1_GAA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(s(X), Y, Z) → U1_AGA(X, Y, Z, avg_in_aga(X, s(Y), Z))
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → U2_AGA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → U2_GAA(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → U2_GAG(X, Y, Z, avg_in_gaa(s(X), Y, Z))
AVG_IN_GAG(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x3, x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x2, x3, x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x2, x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x1, x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x2, x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg(x2, x3)
avg_out_gag(x1, x2, x3)  =  avg_out_gag(x1, x3)
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x4)
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x1, x4)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x4)
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAG(x1, x2, x3)  =  AVG_IN_GAG(x1, x3)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x1, x4)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x3, x4)
U1_AGA(x1, x2, x3, x4)  =  U1_AGA(x2, x4)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)
U1_AGG(x1, x2, x3, x4)  =  U1_AGG(x2, x3, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x3, x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x2, x3, x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x2, x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x1, x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x2, x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg(x2, x3)
avg_out_gag(x1, x2, x3)  =  avg_out_gag(x1, x3)
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x4)
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)
AVG_IN_AGA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(s(X), Y, Z) → AVG_IN_AGA(X, s(Y), Z)
AVG_IN_GAA(X, s(s(s(Y))), s(Z)) → AVG_IN_GAA(s(X), Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
AVG_IN_AGA(x1, x2, x3)  =  AVG_IN_AGA(x2)
AVG_IN_GAA(x1, x2, x3)  =  AVG_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Instantiation
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_GAA(X) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)
AVG_IN_AGA(Y) → AVG_IN_AGA(s)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule AVG_IN_AGA(Y) → AVG_IN_AGA(s) we obtained the following new rules:

AVG_IN_AGA(s) → AVG_IN_AGA(s)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
QDP
                            ↳ Instantiation
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_AGA(s) → AVG_IN_AGA(s)
AVG_IN_GAA(X) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule AVG_IN_GAA(X) → AVG_IN_GAA(s) we obtained the following new rules:

AVG_IN_GAA(s) → AVG_IN_GAA(s)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Instantiation
QDP
                                ↳ NonTerminationProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_AGA(s) → AVG_IN_AGA(s)
AVG_IN_GAA(s) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

AVG_IN_AGA(s) → AVG_IN_GAA(s)
AVG_IN_AGA(s) → AVG_IN_AGA(s)
AVG_IN_GAA(s) → AVG_IN_GAA(s)
AVG_IN_GAA(s) → AVG_IN_AGA(s)

The TRS R consists of the following rules:none


s = AVG_IN_AGA(s) evaluates to t =AVG_IN_AGA(s)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from AVG_IN_AGA(s) to AVG_IN_AGA(s).





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)

The TRS R consists of the following rules:

avg_in_gag(s(X), Y, Z) → U1_gag(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(s(X), Y, Z) → U1_agg(X, Y, Z, avg_in_agg(X, s(Y), Z))
avg_in_agg(X, s(s(s(Y))), s(Z)) → U2_agg(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(s(X), Y, Z) → U1_gaa(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(s(X), Y, Z) → U1_aga(X, Y, Z, avg_in_aga(X, s(Y), Z))
avg_in_aga(X, s(s(s(Y))), s(Z)) → U2_aga(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(X, s(s(s(Y))), s(Z)) → U2_gaa(X, Y, Z, avg_in_gaa(s(X), Y, Z))
avg_in_gaa(0, 0, 0) → avg_out_gaa(0, 0, 0)
avg_in_gaa(0, s(0), 0) → avg_out_gaa(0, s(0), 0)
avg_in_gaa(0, s(s(0)), s(0)) → avg_out_gaa(0, s(s(0)), s(0))
U2_gaa(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gaa(X, s(s(s(Y))), s(Z))
U2_aga(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_aga(X, s(s(s(Y))), s(Z))
avg_in_aga(0, 0, 0) → avg_out_aga(0, 0, 0)
avg_in_aga(0, s(0), 0) → avg_out_aga(0, s(0), 0)
avg_in_aga(0, s(s(0)), s(0)) → avg_out_aga(0, s(s(0)), s(0))
U1_aga(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_aga(s(X), Y, Z)
U1_gaa(X, Y, Z, avg_out_aga(X, s(Y), Z)) → avg_out_gaa(s(X), Y, Z)
U2_agg(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_agg(X, s(s(s(Y))), s(Z))
avg_in_agg(0, 0, 0) → avg_out_agg(0, 0, 0)
avg_in_agg(0, s(0), 0) → avg_out_agg(0, s(0), 0)
avg_in_agg(0, s(s(0)), s(0)) → avg_out_agg(0, s(s(0)), s(0))
U1_agg(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_agg(s(X), Y, Z)
U1_gag(X, Y, Z, avg_out_agg(X, s(Y), Z)) → avg_out_gag(s(X), Y, Z)
avg_in_gag(X, s(s(s(Y))), s(Z)) → U2_gag(X, Y, Z, avg_in_gaa(s(X), Y, Z))
U2_gag(X, Y, Z, avg_out_gaa(s(X), Y, Z)) → avg_out_gag(X, s(s(s(Y))), s(Z))
avg_in_gag(0, 0, 0) → avg_out_gag(0, 0, 0)
avg_in_gag(0, s(0), 0) → avg_out_gag(0, s(0), 0)
avg_in_gag(0, s(s(0)), s(0)) → avg_out_gag(0, s(s(0)), s(0))

The argument filtering Pi contains the following mapping:
avg_in_gag(x1, x2, x3)  =  avg_in_gag(x1, x3)
s(x1)  =  s
U1_gag(x1, x2, x3, x4)  =  U1_gag(x3, x4)
avg_in_agg(x1, x2, x3)  =  avg_in_agg(x2, x3)
U1_agg(x1, x2, x3, x4)  =  U1_agg(x2, x3, x4)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x4)
avg_in_gaa(x1, x2, x3)  =  avg_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
avg_in_aga(x1, x2, x3)  =  avg_in_aga(x2)
U1_aga(x1, x2, x3, x4)  =  U1_aga(x2, x4)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
0  =  0
avg_out_gaa(x1, x2, x3)  =  avg_out_gaa(x1, x3)
avg_out_aga(x1, x2, x3)  =  avg_out_aga(x2, x3)
avg_out_agg(x1, x2, x3)  =  avg_out_agg(x2, x3)
avg_out_gag(x1, x2, x3)  =  avg_out_gag(x1, x3)
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x4)
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(s(X), Y, Z) → AVG_IN_AGG(X, s(Y), Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
AVG_IN_AGG(x1, x2, x3)  =  AVG_IN_AGG(x2, x3)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(Y, Z) → AVG_IN_AGG(s, Z)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule AVG_IN_AGG(Y, Z) → AVG_IN_AGG(s, Z) we obtained the following new rules:

AVG_IN_AGG(s, z1) → AVG_IN_AGG(s, z1)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
QDP
                            ↳ ATransformationProof

Q DP problem:
The TRS P consists of the following rules:

AVG_IN_AGG(s, z1) → AVG_IN_AGG(s, z1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ ATransformationProof
QDP
                                ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

s(z1) → s(z1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

s(z1) → s(z1)

The TRS R consists of the following rules:none


s = s(z1) evaluates to t =s(z1)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from s(z1) to s(z1).